# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from __future__ import print_function
from __future__ import unicode_literals

import winnotify
import os

n = winnotify.NotifyIcon(b"c"*16, tooltip="Test Balloon Notifications",
    icon=winnotify.OEMIcon(winnotify.OEMIcon.ICON_SHIELD))
n.add()

raw_input("Press ENTER to show a balloon notification with no icon or title")
n.balloon = winnotify.Balloon("This is the text of my balloon notification!")
n.update()

raw_input("Press ENTER to remove the currently-displayed balloon notification")
n.balloon.text = ""
n.update()

raw_input("Press ENTER to show a balloon notification with no icon, but with a title")
n.balloon = winnotify.Balloon(
    text="This is the text of my balloon notification!",
    title="Balloon Notification Title"
)
n.update()

raw_input("Press ENTER to show a balloon notification with the 'information' icon")
n.balloon = winnotify.Balloon(
    text="You should see the \"information\" icon",
    title="Balloon Notification Title",
    icon=n.balloon.ICON_INFO
)
n.update()

raw_input("Press ENTER to show a balloon notification with the 'warning' icon")
n.balloon = winnotify.Balloon(
    text="You should see the \"warning\" icon",
    title="Balloon Notification Title",
    icon=n.balloon.ICON_WARNING
)
n.update()

raw_input("Press ENTER to show a balloon notification with the 'error' icon")
n.balloon = winnotify.Balloon(
    text="You should see the \"error\" icon",
    title="Balloon Notification Title",
    icon=n.balloon.ICON_ERROR
)
n.update()

raw_input("Press ENTER to show a balloon notification with the same icon as the NotifyIcon")
n.balloon = winnotify.Balloon(
    text="You should see the same icon as the NotifyIcon (ie. the shield)",
    title="Balloon Notification Title",
    icon=n.balloon.ICON_FROM_OWNER
)
n.update()

raw_input("Press ENTER to show a balloon notification with a stock icon")
stock_icon = winnotify.StockIcon(winnotify.StockIcon.ICON_APPLICATION)
n.balloon = winnotify.Balloon(
    text="You should see a \"generic application\" icon",
    title="Balloon Notification Title",
    icon=stock_icon
)
n.update()

raw_input("Press ENTER to show a balloon notification with a custom icon")
ico_dir = os.path.dirname(__file__)
ico_path = os.path.join(ico_dir, "icon2.ico")
custom_icon = winnotify.ICOIcon(ico_path)
n.balloon = winnotify.Balloon(
    text="You should see the custom icon",
    title="Balloon Notification Title",
    icon=custom_icon
)
n.update()

raw_input("Press ENTER to remove the notification icon")
n.remove()
